package com.bang.daybreak.test.model.entity;

import com.bang.daybreak.common.annotation.Desensitized;
import com.bang.daybreak.common.framework.model.convert.Convert;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;

import javax.validation.constraints.NotNull;

/**
 * <p>
 * 测试脱敏。
 * </p>
 *
 * @version 1.0
 * @author : wdj
 * @since : 2019/7/28 0028 上午 10:25
 */

/*** 注意这里注解的使用，需要自定义toString方法。**/
@Data
@EqualsAndHashCode(callSuper = true)
@Accessors(chain = true)
@TableName("desensitize")
public class Desensitize extends Convert {


    private static final long serialVersionUID = 6009397949248581119L;
    private String id;
    /**
     * 姓名加密
     */
    @NotNull
    @Desensitized(prefixNonSensitiveLen = 1)
    private String name;


    /**
     * 密码全部加密
     */
    @NotNull
    @Desensitized
    private String password;


    /**
     * 银行卡号加密
     */
    @NotNull
    @Desensitized(suffixNonSensitiveLen = 4)
    private String bankCardNo;


    /**
     * 手机号加密
     */
    @Desensitized(prefixNonSensitiveLen = 3, suffixNonSensitiveLen = 3)
    private String mobile;
    /**
     * 邮箱密
     */
    @Desensitized(prefixNonSensitiveLen = 3, suffixNonSensitiveLen = 4, character = "@")
    private String email;

    private String bankName;

}
